#
# @lc app=leetcode.cn id=3142 lang=python
#
# [3142] 判断矩阵是否满足条件
#

# @lc code=start
class Solution(object):
    def satisfiesConditions(self, grid):
        """
        :type grid: List[List[int]]
        :rtype: bool
        """

        for i in range(1,len(grid)):
            if grid[i]!=grid[i-1]:
                return False
        for i in range(1,len(grid[0])):
            if grid[0][i]== grid[0][i-1]:
                return False
        return True
# @lc code=end

